<?php
require_once("dompdf/dompdf_config.inc.php");
$id = $_GET['id'];
$roof = explode("_",trim($_GET['roof']));
$garage = $_GET['garage'];
$windowframes = $_GET['windowframes'];
$gutter = $_GET['gutter'];
$front_door = $_GET['front_door'];
$feature_wall = $_GET['feature_wall'];
$gable = $_GET['gable'];
$paving = $_GET['paving'];
$main_render = $_GET['main_render'];
$barge_scribe = $_GET['barge_scribe'];
if ($main_render==""){
	$main_render="No color";
}
if ($gable==""){
	$gable="No color";
}
if ($barge_scribe==""){
	$barge_scribe="No color";
}
if($roof[0]=="RoofTile"){
	$roof_active_rooftile = $roof[1];
	$roof_active_roofmetal = "";
}else if($roof[0]=="RoofMetal"){
	$roof_active_roofmetal = $roof[1];
	$roof_active_rooftile = "";
	}
switch ($id){
	case 1:
	$name = "colonia";
	break;
	case 2:
	$name = "contemporary";
	break;
	case 3:
	$name = "urban";
	break;
}
$date = date('j/m/Y');
$head = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
  <link rel="stylesheet" href="css/pdf.css">
  <style>
	body{background:none;}
	ul{list-style:none;}
	ul li{font-size:10px;}	#logo{margin-left:580px;margin-top:30px;position:absolute;}
	.page_content div span{margin-left:450px;font-size:10px;}
	table{width:740px;margin-top:20px;}
	td{font-size:10px;border:1px solid #f1f1f1;width:50px;text-align:center;}
	.first{font-weight:bold;}
  </style>
  </head>
  <body>
	<header id="header">
		<div id="logo">
				<img src="img/logo_1.jpg" width="144px" height="152px";/>
		</div>
		<div id="wrapper">
			<h2>Home buyers Center</h2>
			<ul>
			<li>Simple Dumpsters</li>
			<li>645 W 9th Street</li>
			<li>Unit 110-142</li>
			<li>Los Angeles, CA 90015</li>
			<li>P:(888) 131-751</li>
			<li>F:(888) 604-1262</li>
			<li>Website : <a href="http://homecolourselection.com/">http://homecolourselection.com/</a></li>
		</div>
   </header>';
   $content = '<div class="page_content">
	  <div>
	  <h4>Elevation : '.ucwords($name).'<span>Date:'.$date.'</span></h4>
	  </div>
	  <section id="'.$name.'">
		  <div id="color_bond_roof" class="overlay '.$roof_active_roofmetal.'"></div>
		  <div id="roof_tiles" class="overlay '.$roof_active_rooftile.'"></div>
		  <div id="garage_doors" class="overlay '.$garage.'"></div>
		  <div id="window_frames" class="overlay '.$windowframes.'"></div>
		  <div id="gutter_fascia" class="overlay '.$gutter.'"></div>
		  <div id="driveway_paving" class="overlay '.$paving.'"></div>
		  <div id="feature_wall" class="overlay '.$feature_wall.'"></div>
		  <div id="front_door" class="overlay '.$front_door.'"></div>
		  <div id="barge_scribe" class="overlay '.$barge_scribe.'"></div>
		  <div id="gable_infill" class="overlay '.$gable.'"></div>
		  <div id="landscaping" class="overlay landscapingforeground"></div> 
		  <div id="'.$name.'_original"></div>
	  </section>';
		   $foot = '<table><tr><td class="first" valign="middle">Decription</td><td width="55px" valign="middle">Roof-Tiles</td><td width="55px" valign="middle">Roof-Metal</td><td width="55px" valign="middle">Window Frames</td><td width="55px" valign="middle">Garage Door</td><td width="55px" valign="middle">Gutter Fascia</td><td width="55px" valign="middle">Bagrge & Sribe</td><td width="55px" valign="middle">Gable Infill</td><td width="55px" valign="middle">Feature Wall</td><td width="55px" valign="middle">Front Door</td><td width="55px" valign="middle">Paving</td><td width="55px" valign="middle">Main Render</td></tr>
			<tr><td class="first">Name Color</td><td valign="middle">'.ucwords($roof_active_rooftile).'</td><td valign="middle">'.ucwords($roof_active_roofmetal).'</td><td valign="middle">'.ucwords($windowframes).'</td><td valign="middle">'.ucwords($garage).'</td><td valign="middle">'.ucwords($gutter).'</td><td valign="middle">'.ucwords($barge_scribe).'</td><td valign="middle">'.ucwords($gable).'</td><td valign="middle">'.ucwords($feature_wall).'</td><td valign="middle">'.ucwords($front_door).'</td><td valign="middle">'.ucwords($paving).'</td><td valign="middle">'.ucwords($main_render).'</td></tr>
			</table></div>
		</body></html>';
switch($id){
case 1:
$html = $head.$content.$foot;
  break;
  case 2:
  $html = $head.$content.$foot;
  break;
  case 3:
  $html = $head.$content.$foot;
}
$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->render();
$dompdf->stream("BuildHouse_".$date.".pdf");
?>
